UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'izoobKmr8UVT3Vt09G7K0zH4ZgqsLPprRxob0Mt0U/g='
WHERE
key_id = 'f1107303c31bfae9d53d22f2bc46a5b167e374cecf05d313317de235c2fd867e'
AND (
token = 'izoobKmr8UVT3Vt09G7K0zH4ZgqsLPprRxob0Mt0U/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)