UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gkt+A9hEQ2SV9jsEbTCFpW2fC9DfNQpOitf7uTaG4qI=' 
WHERE 
  key_id = 'c9b594b86f15ccf3a9682bd74ab58b4e160d6268b8d93b4af815423a4dd75f5f' 
  AND (
    token = 'Gkt+A9hEQ2SV9jsEbTCFpW2fC9DfNQpOitf7uTaG4qI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041