UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sk043c7cie8ntQE1CeTiSM/il47CIEAVXB5IOXsyH4E='
WHERE
key_id = '636f49db00f7d149c1f02ae13bd6eb644590300c2b78daf00b5845d51f466a6e'
AND (
token = 'Sk043c7cie8ntQE1CeTiSM/il47CIEAVXB5IOXsyH4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)