UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h2qALlwWTKIssIP9v5y8IQXYYl7aWpr/icnvuaFCC9U='
WHERE
key_id = 'f273925aab9de3c4745801056b9dd4c4afe184b8b2b0f831fea2725b05838a0d'
AND (
token = 'h2qALlwWTKIssIP9v5y8IQXYYl7aWpr/icnvuaFCC9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)