UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u6HMzwX4mkeqnToH0sCQ2S0K7ri9e5lcF4u0AUM2dSM='
WHERE
key_id = 'cce25e12d5b99e3b5e1ab079f97a1531bd189bdca3a66a83a28a3dcb8643fda1'
AND (
token = 'u6HMzwX4mkeqnToH0sCQ2S0K7ri9e5lcF4u0AUM2dSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)