UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UcA71T0h+iQPFIHRHknyJWzrf7jNZZEtaLa74Ltni9M='
WHERE
key_id = '67b01698fe1f53244ce3e6e7f40409fbc28c15e941146383528dc9db42fde7c1'
AND (
token = 'UcA71T0h+iQPFIHRHknyJWzrf7jNZZEtaLa74Ltni9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)