UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dNHap6236V50gVXvDylhi+/yyA6wCDzVG1/PRUXxzyE='
WHERE
key_id = '9f9558e5832a87d81fe0bfd56daf7d9c6263f2bd688b89966f468eaa557e9e64'
AND (
token = 'dNHap6236V50gVXvDylhi+/yyA6wCDzVG1/PRUXxzyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)