UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLp0GHqTlRyy++tWY1aeQA18Hm0HThAX+U9lUwFG3ao='
WHERE
key_id = 'd1b6aa9ed14444f6db0bd475acf8cb00749c5836118c4ca4a8a5b9db42533d41'
AND (
token = 'HLp0GHqTlRyy++tWY1aeQA18Hm0HThAX+U9lUwFG3ao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)