UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rzsnNbjdIQxAHtnU73tMXRItCpOMSnHXHoar+r2iaSk='
WHERE
key_id = 'dba4b9de2913f664775648d53f5c38125ee7aebcffdb1f9390a8f0b7dd3ea79e'
AND (
token = 'rzsnNbjdIQxAHtnU73tMXRItCpOMSnHXHoar+r2iaSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)