UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1GHqA8HWMOTugdv4sN2ETmhH1+ycmKlWoHSg6EaxFoo='
WHERE
key_id = 'f3d0a6cfbce6156778d73b6184f446d3d9a66aa9adca2ad54ad3640dc7c8f9f8'
AND (
token = '1GHqA8HWMOTugdv4sN2ETmhH1+ycmKlWoHSg6EaxFoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)