UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nRruhKSiJCZfm7vEWu/it9tB3aEHUNmCC6WxuiFUvK4='
WHERE
key_id = '3be0a2800d11629a9477d4e466be360815654c2c70ee0e6dd165208e2a74c41a'
AND (
token = 'nRruhKSiJCZfm7vEWu/it9tB3aEHUNmCC6WxuiFUvK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)