UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pqk/NGK4Y8GsdTzMwCB1C/af9T4mFYUB7zfOfqUoQRw='
WHERE
key_id = 'e26a46dd07c4233b5ae8d78f59aebcb06025d9bcc960455c32e164a3c18e940e'
AND (
token = 'pqk/NGK4Y8GsdTzMwCB1C/af9T4mFYUB7zfOfqUoQRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)