UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F279LkJmyJS9qSfDWS/8c5tK8DLP+f33lrgL3y31UIY=' 
WHERE 
  key_id = '2faa5e935db6c658dbfd673e52b826ac17df1346ae5a2b562a2333de1c0798e7' 
  AND (
    token = 'F279LkJmyJS9qSfDWS/8c5tK8DLP+f33lrgL3y31UIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057