UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b6cUVsPYM1/f53J5tw4/l1UIy0f/7U7P4XYeESMIf5E='
WHERE
key_id = '11c53539e1bf58ceafaa8efa73b0c1f312aa3c0e1a2effa5c6c5160177e2e83c'
AND (
token = 'b6cUVsPYM1/f53J5tw4/l1UIy0f/7U7P4XYeESMIf5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)