UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5iQTlG73EGODGw0Jzh7AjuSjMzu1hLDIYziaLwXLB8='
WHERE
key_id = '6885e268f0b497e0a3184307866e2aedbd11f1257d53d3dea20dd398b5bb91c0'
AND (
token = 'l5iQTlG73EGODGw0Jzh7AjuSjMzu1hLDIYziaLwXLB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)