UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UoFL9dOP2yNNzr4UkfTLsHcMLoEmFZiRsvYypvPH0S8='
WHERE
key_id = '8a92e0fe9cc592f682b0dac2670266a4958758411ca4448b3d3b1cd1c68ff887'
AND (
token = 'UoFL9dOP2yNNzr4UkfTLsHcMLoEmFZiRsvYypvPH0S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)