UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YqnTkTiU02zhEeMOPiDRqDrtpi5V71EukFqpG65lP8g='
WHERE
key_id = '036310e74a078bdb811c94b4eedae3673b12ae2dcbf06ab0c17fa67cec65fbad'
AND (
token = 'YqnTkTiU02zhEeMOPiDRqDrtpi5V71EukFqpG65lP8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)