UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Z9MTngfmdBUhrM5oPHeBbkbxFLq2jNsRodp0c2RnTU='
WHERE
key_id = '24e132c7058bdd10e29d68630fe86be950dfbb4503775dc75789e80814eea1c5'
AND (
token = '9Z9MTngfmdBUhrM5oPHeBbkbxFLq2jNsRodp0c2RnTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)