UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rxIAPyE4BUjsLn4wTkcmFq3w0OuDuK9JQK5oIy5qQKE='
WHERE
key_id = '98aa793984472746bbc2df3c01e4c18743fd2a42e999eeee18c934f0955f8cc1'
AND (
token = 'rxIAPyE4BUjsLn4wTkcmFq3w0OuDuK9JQK5oIy5qQKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)