UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7+TPxkbBzRTau1MBUI3RYOTF5JpsaZa+yqMr7CgqhLU='
WHERE
key_id = '3ea59b176d1a8b69920cc7814e6ab8697d1d1ecda4518fd0b3742096e0302362'
AND (
token = '7+TPxkbBzRTau1MBUI3RYOTF5JpsaZa+yqMr7CgqhLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)