UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98CHfQnvoWjM9fQ1B6BiiX+CNSDBWfxr6ZL97SGVOJU='
WHERE
key_id = '081f5f4dc37610640366f8110d66304eba4ed27d924e03eff822171b1911629d'
AND (
token = '98CHfQnvoWjM9fQ1B6BiiX+CNSDBWfxr6ZL97SGVOJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)