UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OqhV+dmcsOLkfDMV7owgL9mOcn5/FavMDQJx9mgPHuM=' 
WHERE 
  key_id = 'de8a5a596347dda300f8d131e79e8d092f6afeffad560cd3e14b5bb016da3c72' 
  AND (
    token = 'OqhV+dmcsOLkfDMV7owgL9mOcn5/FavMDQJx9mgPHuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032