UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F03FpiKDrqkfYoWhFSMMQNOHf2vZ8vRast1iqPXtWVw='
WHERE
key_id = '0d0657d5af428f22c72d0d4b6cb1983c31b7914ca6fe33c693b18915374f348e'
AND (
token = 'F03FpiKDrqkfYoWhFSMMQNOHf2vZ8vRast1iqPXtWVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)