UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O2GRxBTJ/Zl1OPUUWS464c/f55o71vUvT8XfKR3ywSM='
WHERE
key_id = '8038270b769f242a50305924f8cb33b31f9d5e2be79eee8fe257482755785b4a'
AND (
token = 'O2GRxBTJ/Zl1OPUUWS464c/f55o71vUvT8XfKR3ywSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)