UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NIsSEVzEDFpPiiXHhnpEBZOjXsMSR7A8YqS2Tm/umNg='
WHERE
key_id = 'a66603d2e7e9ccd1a7aeb2975ee58c943a8163202ad9d6b1b978e1719641ded1'
AND (
token = 'NIsSEVzEDFpPiiXHhnpEBZOjXsMSR7A8YqS2Tm/umNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)