UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bw4iXCwCDIWoJujNsBBCw5sDUIqghKFcB5higCKcbpA='
WHERE
key_id = '729b03fac88d46b7368061b16c2db35c0e99764d1a02f6de823d8280bd812bd1'
AND (
token = 'bw4iXCwCDIWoJujNsBBCw5sDUIqghKFcB5higCKcbpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)