UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zo4If77DqpiPIiFw/ZziOV8d6CEZcCrL0fIITd6yR1M='
WHERE
key_id = '0ebd5d004b36881b44530bacf84499e346b98ae4eb9cfc294cc6fd80e1c4a40d'
AND (
token = 'zo4If77DqpiPIiFw/ZziOV8d6CEZcCrL0fIITd6yR1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)