UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xshf4xQFMcE/oueS2mfcIRha2BFs2wirfPAjMlGpAZw='
WHERE
key_id = 'ecd79a8bca5d4c41dffc8637b5aae31f7d838d29c2326177ab80f966778a703e'
AND (
token = 'Xshf4xQFMcE/oueS2mfcIRha2BFs2wirfPAjMlGpAZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)