UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ea4X8RrY/p5TwAZkQSX2Dt9xEDc3ZYkj69E/jV5VuU='
WHERE
key_id = 'cb7af1ff5cbf3ae14f9eb7cc53597c5fd702dcecd4c9b7a996b46ba7210470a1'
AND (
token = '6ea4X8RrY/p5TwAZkQSX2Dt9xEDc3ZYkj69E/jV5VuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)