UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qw0hCLz2cnxmTOs1WHdf0OeHGa/TVeGZz1CbOsH0oak='
WHERE
key_id = '0baa20eda5cc8089fcc73b87f9ed02cd07b199ad6784dc55dec5affcb2b34cfe'
AND (
token = 'qw0hCLz2cnxmTOs1WHdf0OeHGa/TVeGZz1CbOsH0oak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)