UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DQmdQcynGmJ+MvpsH4Z7hAyPGc0AI5I1ibVA9ccRrlw=' 
WHERE 
  key_id = 'ad2f29f602b44fb6c506aa3b84d0086115ce99683d394ac8e48c0db04db2e9b7' 
  AND (
    token = 'DQmdQcynGmJ+MvpsH4Z7hAyPGc0AI5I1ibVA9ccRrlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033