UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AamO2VyMbpLK0fVfcC8mkRJNU2t4hYTC48K0rfgIfT0=' 
WHERE 
  key_id = '7cbad83defd6ab26ad10d0e179717f26c1e603f6dfc578f16bdaebb2a371271e' 
  AND (
    token = 'AamO2VyMbpLK0fVfcC8mkRJNU2t4hYTC48K0rfgIfT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021