UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zsVTCCclEwLFn+zH1PcD84UHpH1+Ft2BkujfL0NybYY=' 
WHERE 
  key_id = '007fe8f74683e832d6d7e838fb54a2b35695c7b2b14dd3bf2aa4b6460a270e98' 
  AND (
    token = 'zsVTCCclEwLFn+zH1PcD84UHpH1+Ft2BkujfL0NybYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035