UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FO1IpxQP4i/ZYIVc1xdvJSks6G0phAavNxH2DJ1FepY='
WHERE
key_id = '2052d52b0d81ae31b9ee050e5205dba35428d238bc5e05e89ec4506f60830ebe'
AND (
token = 'FO1IpxQP4i/ZYIVc1xdvJSks6G0phAavNxH2DJ1FepY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)